﻿// Yaml1dot2Test.cs
//
// Copyright 2008-2009 by Burt Harris
// Licensed under the Microsoft Public License (Ms-PL)
// See: http://www.codeplex.com/yaml/license
//

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace YaTools.Yaml.UnitTests
{
    [TestClass]
    [DeploymentItem(@"CoreUnitTest\Yaml_1.2\")]
    public class Y12Examples : YamlParserTest
    {
        // ReSharper disable InconsistentNaming
        [TestMethod]
        public void Y12_08_02()
        {
            var expected = new object[]
                               {
                                   ParseEvent.SequenceStart,
                                   "detected\n",
                                   "\n\n# detected\n",
                                   " explicit\n",
                                   "\t\ndetected\n",
                                   ParseEvent.End
                               };

            FileTest("08.02.a.yaml", expected);
            FileTest("08.02.b.yaml", expected);
        }

        [TestMethod]
        public void Y12_08_07()
        {
            FileTest("08.07.a.yaml", "literal\n\ttext\n");
            FileTest("08.07.b.yaml", "literal\n\ttext\n");
        }


        [TestMethod]
        public void Y12_08_08()
        {
            FileTest("08.08.a.yaml", "\n\nliteral\n \n\ntext\n");
            FileTest("08.08.b.yaml", "\n\nliteral\n \n\ntext\n");
        }


        [TestMethod]
        public void Y12_02_01()
        {
            var expected = new object[]
                               {
                                   ParseEvent.SequenceStart,
                                   "Mark McGwire",
                                   "Sammy Sosa",
                                   "Ken Griffey",
                                   ParseEvent.End
                               };
            FileTest("02.01.a.yaml", expected);
            FileTest("02.01.b.yaml", expected);
        }

        [TestMethod]
        public void Y12_02_02()
        {
            var expected = new object[]
                               {
                                   ParseEvent.MappingStart,
                                   "hr", "65",
                                   "avg", "0.278",
                                   "rbi", "147",
                                   ParseEvent.End
                               };
            FileTest("02.02.a.yaml", expected);
            FileTest("02.02.b.yaml", expected);
        }

        // ReSharper restore InconsistentNaming
    }
}